<xsl:stylesheet version="2.0" xmlns:foo="http://something" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:import href="/apps/engine/utils/translate_fct.xsl"/>
	<xsl:variable name="dict" select="doc('input:translation')/translation"/>
	<xsl:variable name="userSpecific" select="doc('input:userSpecific')"/>
	<xsl:variable name="user" select="/submission/edit"/>

	<xsl:template match="/">
		<content>
			<h1>
				<xsl:if test="$user = ''">
					<xsl:value-of select="foo:translate('User account creation', $dict)"/>
				</xsl:if>
				<xsl:if test="$user != ''">
					<xsl:value-of select="foo:translate('User account edition', $dict)"/>
				</xsl:if>
			</h1>
			<form id="users_form" method="post" action="../action/user">
				<fieldset id="identifiers_section">
					<xsl:if test="$user != ''">
						<input type="hidden" name="userId" value="{$user}"/>
					</xsl:if>
					<legend>
						<xsl:value-of select="foo:translate('Identifiers', $dict)"/>
					</legend>
					<div class="form_line">
						<label for="username">
							<xsl:value-of select="foo:translate('Username', $dict)"/> *</label>
						<input class="text" type="text" id="username" name="username" tabindex="1" maxlength="30" value="{$user}"/>
					</div>
					<div class="form_line">
						<label for="password">
							<xsl:value-of select="foo:translate('Password', $dict)"/>
							<xsl:if test="$user = ''"> *</xsl:if>
						</label>
						<input class="text" type="password" id="password" name="password" tabindex="2"/>
					</div>
				</fieldset>
				<fieldset>
					<legend>
						<xsl:value-of select="foo:translate('Language', $dict)"/>
					</legend>

					<label for="language">
						<xsl:value-of select="foo:translate('User interface language', $dict)"/>
					</label>
					<select id="language" name="lang" tabindex="5">
						<option value="en">
							<xsl:if test="$userSpecific/userspecific/lang = 'en'">
								<xsl:attribute name="selected">true</xsl:attribute>
							</xsl:if>English</option>
						<option value="fr">
							<xsl:if test="$userSpecific/userspecific/lang = 'fr'">
								<xsl:attribute name="selected">true</xsl:attribute>
							</xsl:if>Fran&#231;ais</option>
					</select>
				</fieldset>
				<fieldset>
					<legend>
						<xsl:value-of select="foo:translate('Rights', $dict)"/>
					</legend>

					<label for="rights">
						<xsl:value-of select="foo:translate('User type', $dict)"/>
					</label>
					<select id="rights" name="level" tabindex="5">
						<option value="0">
							<xsl:if test="$userSpecific/userspecific/level = '0'">
								<xsl:attribute name="selected">true</xsl:attribute>
							</xsl:if>Simple User</option>
						<option value="2">
							<xsl:if test="$userSpecific/userspecific/level = '2'">
								<xsl:attribute name="selected">true</xsl:attribute>
							</xsl:if>Administrator</option>
					</select>
				</fieldset>
				<div class="additional_info">
					<xsl:value-of select="foo:translate('Fields labelled with * are mandatory.', $dict)"/>
				</div>
				<div class="submit">
					<input class="button" type="submit" value="{foo:translate('Save', $dict)}" id="user_pref" name="user_pref" tabindex="6"/>
					<input class="button" type="reset" value="{foo:translate('Reset', $dict)}" tabindex="7"/>
				</div>
			</form>
		</content>
	</xsl:template>
</xsl:stylesheet>